package com.zkh.myutils.net.utils;

/**
 * 响应码工具
 * @author zkh
 */
public class Reply {

	/**
	 * 响应码[100, 200)
	 * @param reply 响应码
	 * @return
	 */
	public static boolean isPositivePreliminary(int reply) {
		return (reply >= 100 && reply < 200);
	}
	
	/**
	 * 响应码[200, 300)
	 * @param reply 响应码
	 * @return
	 */
	public static boolean isPositiveCompletion(int reply){
		return (reply >= 200 && reply < 300);
	}
	
	/**
	 * 响应码[300, 400)
	 * @param reply 响应码
	 * @return
	 */
	public static boolean isPositiveIntermediate(int reply){
		return (reply >= 300 && reply < 400);
	}
	
	/**
	 * 响应码[400, 500)
	 * @param reply 响应码
	 * @return
	 */
	public static boolean isNegativeTransient(int reply){
		return (reply >= 400 && reply < 500);
	}
	
	/**
	 * 响应码[500, 600)
	 * @param reply 响应码
	 * @return
	 */
	public static boolean isNegativePermanent(int reply){
		return (reply >= 500 && reply < 600);
	}
	
	/**
	 * 响应码[500, 600)
	 * @param reply 响应码
	 * @return
	 */
	public static boolean isProtectedReplyCode(int reply){
		return (reply >= 600 && reply < 700);
	}
}
